#ifndef CONFIG_H
#define CONFIG_H

#include <QRegularExpression>
#include "qmap.h"
#include "qstring.h"

class Config
{
public:
    Config();
    ~Config();
    static bool readConfig();
    static bool saveConfig();
    static void savelog(QString logstr);
    static void removeConfig(QString _pName);
    static QString readConfigValue(QString _pName, bool log = false);
    static void writeConfigValue(QString _pName, QString _pValue);
    static void writeConfigValue(QString _pName, int _pValue);
    static quint32 IPV4StringToInteger(const QString& ip);
public:
    QString userName;
private:
    static QString applicationDirPath;
    static QMap<QString, QString> configMap;
    static QString midStr(QString oldStr, QString startStr, QString endStr);

};


#endif // CONFIG_H
